<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link rel="stylesheet" href="/css/lightbox.css">
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<div class="col-sm-12">
							<h4>编辑商品</h4>
						</div>
						<form class="form-horizontal m-t" id="signupForm">
							<input name="id" type="hidden" th:value="${goods.id}">
							<div class="form-group">
								<label class="col-sm-2 control-label">标题：</label>
								<div class="col-sm-4">
									<input id="title" name="title" class="form-control" type="text" th:value="${goods.title}">
								</div>
								<label class="col-sm-2 control-label">库存单位：</label>
								<div class="col-sm-4">
									<input id="sku" name="sku" class="form-control" type="text" th:value="${goods.sku}">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">商品摘要：</label>
								<div class="col-sm-10">
									<input id="subject" name="subject" class="form-control" type="text" th:value="${goods.subject}">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">列表小图<br /> (650 * 650)：</label>
								<div class="col-sm-10">
									<input id="thumbnailImage" name="thumbnailImageFile" class="form-control" type="file">
									<br />
									<a class="example-image-link" th:href="${ '/files/'  + goods.thumbnailImage}" data-lightbox="example-set" ">
										<img th:if="${goods.thumbnailImage}" class="example-image" th:src="${ '/files/'  + goods.thumbnailImage}" alt="image-1" style="width:100px;"/>
									</a>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">详情大图：</label>
								<div class="col-sm-2">
									<input name="imageLargeFile[0]" class="form-control" type="file">
									<br />
									<div th:if="${image.sortOrder == 0}" th:each="image:${goods.goodsImageList}">
										<a  th:href="${ '/files/'  + image.imageLarge}" class="example-image-link" data-lightbox="example-set" ">
											<img class="example-image" th:src="${ '/files/'  + image.imageLarge}" alt="image-1" style="width:100px;"/>
										</a>
										<br />
										<input type="button" value="删除" class="btn btn-danger btn-xs" th:onclick="'javascript:deleteImage(\''+${image.goodsId}+'\',\''+${image.sortOrder}+'\')'" />
									</div>
								</div>
								<div class="col-sm-2">
									<input name="imageLargeFile[1]" class="form-control" type="file">
									<br />
									<div th:if="${image.sortOrder == 1}" th:each="image:${goods.goodsImageList}">
										<a th:href="${ '/files/'  + image.imageLarge}" class="example-image-link" data-lightbox="example-set" ">
											<img class="example-image" th:src="${ '/files/'  + image.imageLarge}" alt="image-1" style="width:100px;"/>
										</a>
										<br />
										<input type="button" value="删除" class="btn btn-danger btn-xs" th:onclick="'javascript:deleteImage(\''+${image.goodsId}+'\',\''+${image.sortOrder}+'\')'" />
									</div>
								</div>
								<div class="col-sm-2">
									<input name="imageLargeFile[2]" class="form-control" type="file">
									<br />
									<div th:if="${image.sortOrder == 2}" th:each="image:${goods.goodsImageList}">
										<a th:href="${ '/files/'  + image.imageLarge}" class="example-image-link" data-lightbox="example-set" ">
											<img class="example-image" th:src="${ '/files/'  + image.imageLarge}" alt="image-1" style="width:100px;"/>
										</a>
										<br />
										<input type="button" value="删除" class="btn btn-danger btn-xs" th:onclick="'javascript:deleteImage(\''+${image.goodsId}+'\',\''+${image.sortOrder}+'\')'" />
									</div>
								</div>
								<div class="col-sm-2">
									<input name="imageLargeFile[3]" class="form-control" type="file">
									<br />
									<div th:if="${image.sortOrder == 3}" th:each="image:${goods.goodsImageList}">
										<a th:href="${ '/files/'  + image.imageLarge}" class="example-image-link" data-lightbox="example-set" ">
											<img class="example-image" th:src="${ '/files/'  + image.imageLarge}" alt="image-1" style="width:100px;"/>
										</a>
										<br />
										<input type="button" value="删除" class="btn btn-danger btn-xs" th:onclick="'javascript:deleteImage(\''+${image.goodsId}+'\',\''+${image.sortOrder}+'\')'" />
									</div>
								</div>
								<div class="col-sm-2">
									<input name="imageLargeFile[4]" class="form-control" type="file">
									<br />
									<div th:if="${image.sortOrder == 4}" th:each="image:${goods.goodsImageList}">
										<a th:href="${ '/files/'  + image.imageLarge}" class="example-image-link" data-lightbox="example-set" ">
											<img class="example-image" th:src="${ '/files/'  + image.imageLarge}" alt="image-1" style="width:100px;"/>
										</a>
										<br />
										<input type="button" value="删除" class="btn btn-danger btn-xs" th:onclick="'javascript:deleteImage(\''+${image.goodsId}+'\',\''+${image.sortOrder}+'\')'" />
									</div>
								</div>
							</div>
							<hr />
							<div class="form-group">
								<label class="col-sm-2 control-label">市场价：</label>
								<div class="col-sm-2">
									<input id="marketPrice" name="marketPrice" class="form-control" type="number" th:value="${goods.marketPrice}">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">普通会员价：</label>
								<div class="col-sm-2">
									<input id="generalUserPrice" name="generalUserPrice" class="form-control" type="number" th:value="${goods.generalUserPrice}">
								</div>
								<label class="col-sm-2 control-label">白金会员价</label>
								<div class="col-sm-2">
									<input id="platinaUserPrice" name="platinaUserPrice" class="form-control" type="number" th:value="${goods.platinaUserPrice}">
								</div>
								<label class="col-sm-2 control-label">VIP会员价</label>
								<div class="col-sm-2">
									<input id="vipUserPrice" name="vipUserPrice" class="form-control" type="number" th:value="${goods.vipUserPrice}">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">代理商价：</label>
								<div class="col-sm-2">
									<input id="agent1Price" name="agent1Price" class="form-control" type="number" th:value="${goods.agent1Price}">
								</div>
								<label class="col-sm-2 control-label">初级合伙人价</label>
								<div class="col-sm-2">
									<input id="agent2Price" name="agent2Price" class="form-control" type="number" th:value="${goods.agent2Price}">
								</div>
								<label class="col-sm-2 control-label">中级合伙人价</label>
								<div class="col-sm-2">
									<input id="agent3Price" name="agent3Price" class="form-control" type="number" th:value="${goods.agent3Price}">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">高级合伙人价：</label>
								<div class="col-sm-2">
									<input id="agent4Price" name="agent4Price" class="form-control" type="number" th:value="${goods.agent4Price}">
								</div>
								<label class="col-sm-2 control-label">联合创始人价</label>
								<div class="col-sm-2">
									<input id="agent5Price" name="agent5Price" class="form-control" type="number" th:value="${goods.agent5Price}">
								</div>
							</div>
							<hr />
							<div class="form-group">
								<label class="col-sm-2 control-label">是否分润：</label>
								<div class="col-sm-2">
									<label class="radio-inline"> 
										<input name="isFr" type="radio" value="1" th:checked="${goods.isFr == 1}">是
									</label>
									<label class="radio-inline">
										<input name="isFr" type="radio" checked = "checked" value="0" th:checked="${goods.isFr == 0}">否
									</label>
								</div>								
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">普通会员商品积分<br />(单位：分)：</label>
								<div class="col-sm-2">
									<input id="generalUserCredits" name="generalUserCredits" class="form-control" type="number" th:value="${goods.generalUserCredits}">
								</div>
								<label class="col-sm-2 control-label">白金会员商品积分<br />(单位：分)：</label>
								<div class="col-sm-2">
									<input id="platinaUserCredits" name="platinaUserCredits" class="form-control" type="number" th:value="${goods.platinaUserCredits}">
								</div>
								<label class="col-sm-2 control-label">VIP会员商品积分<br />(单位：分)：</label>
								<div class="col-sm-2">
									<input id="vipUserCredits" name="vipUserCredits" class="form-control" type="number" th:value="${goods.vipUserCredits}">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">代理商积分</label>
								<div class="col-sm-2">
									<input id="agent1Credits" name="agent1Credits" class="form-control" type="number" th:value="${goods.agent1Credits}">
								</div>
								<label class="col-sm-2 control-label">初级合伙人积分</label>
								<div class="col-sm-2">
									<input id="agent2Credits" name="agent2Credits" class="form-control" type="number" th:value="${goods.agent2Credits}">
								</div>
								<label class="col-sm-2 control-label">中级合伙人积分</label>
								<div class="col-sm-2">
									<input id="agent3Credits" name="agent3Credits" class="form-control" type="number" th:value="${goods.agent3Credits}">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">高级合伙人积分</label>
								<div class="col-sm-2">
									<input id="agent4Credits" name="agent4Credits" class="form-control" type="number" th:value="${goods.agent4Credits}">
								</div>
								<label class="col-sm-2 control-label">联合创始人积分</label>
								<div class="col-sm-2">
									<input id="agent5Credits" name="agent5Credits" class="form-control" type="number" th:value="${goods.agent5Credits}">
								</div>
							</div>
							<div class="form-group">
								<input id="description" name="description" type="hidden" th:value="${goods.description}">
									<label class="col-sm-2 control-label">图文详情：</label>
								<div class="col-sm-10">
									<div class="ibox-content no-padding">
										<div id="description_cn" class="summernote"></div>
									</div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">上架状态：</label>
								<div class="col-sm-2">
									<select name="isOnsale" class="form-control">
										<option value="0" th:selected="${goods.isOnsale == 0}">未上架</option>
										<option value="1" th:selected="${goods.isOnsale == 1}">已上架</option>
										<option value="2" th:selected="${goods.isOnsale == 2}">已下架</option>
									</select>
								</div>
								<label class="col-sm-2 control-label">排序：</label>
								<div class="col-sm-2">
									<input id="sortOrder" name="sortOrder" class="form-control" type="number" th:value="${goods.sortOrder}">
								</div>
								<label class="col-sm-2 control-label">是否包邮：</label>
								<div class="col-sm-2">
									<label class="radio-inline"> 
										<input name="postFree" type="radio" value="1" th:checked="${goods.postFree == 1}">是
									</label>
									<label class="radio-inline">
										<input name="postFree" type="radio" checked = "checked" value="0" th:checked="${goods.postFree == 0}">否
									</label>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">库存数</label>
								<div class="col-sm-2">
									<input id="amount" name="amount" class="form-control" type="number" th:value="${goods.amount}">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">选择分类：</label>
								<div class="col-sm-10">
									<label class="radio-inline" th:each="category:${categoryList}">
										<input name="categoryIdList" th:checked="${category.isChecked == 1}" type="checkbox" th:value="${category.id}">
										<span th:text="${category.title}"></span>
									</label>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">限购：</label>
								<div class="col-sm-10" th:if="${#lists.isEmpty(goodsLimitList)}">
									<label class="radio-inline" >
										<input name="goodsLimitList[0].limitType" type="checkbox" value="1">
										<span>每位用户每月限购</span>
										<input type="number" name="goodsLimitList[0].limitCount" />
										件
										<input type="hidden" name="goodsLimitList[0].remark" value="每位用户每月限购X件"/>
									</label>
								</div>
								<div class="col-sm-10" th:if="${not #lists.isEmpty(goodsLimitList)}">
									<label class="radio-inline" th:each="limit : ${goodsLimitList}">
										<input  name="goodsLimitList[0].limitType" type="checkbox" th:value="${limit.limitType}" checked="checked">
										<span>每位用户每月限购</span>
										<input type="number" name="goodsLimitList[0].limitCount" th:value="${limit.limitCount}"/>
										件
										<input type="hidden" name="goodsLimitList[0].remark" value="每位用户每月限购X件" th:value="${limit.remark}"/>
									</label>
								</div>
							</div>
							<div class="text-right form-group">
								<a class="btn btn-default waves-effect waves-light" href="/shop/system/goods/manager">返回列表</a>
								<button type="button"
									class="btn btn-primary waves-effect waves-light" type="submit">保存</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script src="/js/lightbox-plus-jquery.min.js"></script>
	<div th:include="include::footer"></div>
	<script type="text/javascript" src="/js/appjs/shop/system/add.js">
	</script>
</body>
</html>
